package com.yanq.liancar.address_selection.utils;
/*
 *  @创建者     liyan
 *  @创建时间   2018/11/6  10:09
 *  @描述       ${TODO}
 */


import android.content.Context;
import android.widget.Toast;

public class ToastUtils {
    public static Toast mToast;



    /**

     * 显示吐司

     * @param context

     * @param message

     */

    public static void showToast(final Context context, final String message){

        if (mToast == null){

            mToast = Toast.makeText(context, message, Toast.LENGTH_SHORT);

        }else{

            mToast.setText(message);

            mToast.setDuration(Toast.LENGTH_SHORT);

        }

        mToast.show();

    }



    /**

     * 显示吐司

     * @param context

     * @param messageResId

     */

    public static void showToast(final Context context, final int messageResId){

        if (mToast == null){

            mToast = Toast.makeText(context, messageResId, Toast.LENGTH_SHORT);

        }else{

            mToast.setText(messageResId);

            mToast.setDuration(Toast.LENGTH_SHORT);

        }

        mToast.show();

    }
}
